package com.starlink.model.util;

import com.starlink.model.dtomapper.MallBooksDtoMapper;
import com.starlink.model.domain.MallBooksDO;
import com.starlink.model.vo.MallBooksVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallBooksConvert {

    public static List<MallBooksVO> buildMallBooksVoList(List<MallBooksDO> mallBooksDOList) {
        if (CollectionUtils.isEmpty(mallBooksDOList)) {
            return Lists.newArrayList();
        }
        List<MallBooksVO> mallBooksVOList = new ArrayList<>();
        for (MallBooksDO mallBooksDO : mallBooksDOList) {
            mallBooksVOList.add(MallBooksDtoMapper.INSTANCE.do2VO(mallBooksDO));
        }

        return mallBooksVOList;
    }
}
